home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Forms Misc / text-reverser.izs < prev    next >
Text File  |  2005-09-28  |  2KB  |  95 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Text Reverser
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION> JavaScript will take the contents of a box and reverse it! If you entered 'hello' it will change the box to say 'olleh'. This might be useful on your site in a form or just for fun. <!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Forms<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL TEXT REVERSER:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <SCRIPT LANGUAGE="JavaScript">
  23.  
  24.  
  25.  
  26. <!-- Begin
  27. function reverse(form) {
  28. text = "";
  29. str = form.revtext.value;
  30. for (i = 0; i <= str.length; i++)
  31. text = str.substring(i, i+1) + text;
  32. form.revtext.value = text;
  33. }
  34. //  End -->
  35. </script>
  36. </HEAD>
  37.  
  38. <!-- STEP TWO: Add code into BODY section of document  -->
  39.  
  40. <BODY>
  41.  
  42. <form>
  43. <input type=text name=revtext value=hello>
  44. <input type=button value="Reverse" onClick="reverse(this.form)">
  45. </form>
  46.  
  47.  
  48.  
  49. <!-- END OF SCRIPT -->
  50. <!/SCRIPT>
  51.  
  52. <!PREVIEW>
  53. <!-- START OF SCRIPT -->
  54.  
  55.  
  56. <!-- HOW TO INSTALL TEXT REVERSER:
  57.  
  58.   1.  Copy code into the HEAD section of document
  59.   2.  Put last coding into the BODY section of document  -->
  60.  
  61. <!-- STEP ONE: Add code into HEAD section of document  -->
  62.  
  63. <HEAD>
  64.  
  65. <SCRIPT LANGUAGE="JavaScript">
  66.  
  67.  
  68.  
  69. <!-- Begin
  70. function reverse(form) {
  71. text = "";
  72. str = form.revtext.value;
  73. for (i = 0; i <= str.length; i++)
  74. text = str.substring(i, i+1) + text;
  75. form.revtext.value = text;
  76. }
  77. //  End -->
  78. </script>
  79. </HEAD>
  80.  
  81. <!-- STEP TWO: Add code into BODY section of document  -->
  82.  
  83. <BODY>
  84.  
  85. <form>
  86. <input type=text name=revtext value=hello>
  87. <input type=button value="Reverse" onClick="reverse(this.form)">
  88. </form>
  89.  
  90.  
  91. <!-- END OF SCRIPT -->
  92. <!/PREVIEW>
  93.  
  94. <!RELATED>NONE<!/RELATED>
  95.